// 权限管理接口
import instance from '@/utils/request'

// 根据 id 更新权限点详情
export function uploadPerApi(data) {
  return instance({
    url: `/sys/permission/${data.id}`,
    method: 'PUT',
    data
  })
}

// 根据 id 获取权限点详情
export function getPerDataApi(id) {
  return instance({
    url: `/sys/permission/${id}`,
    method: 'GET',
  })
}

// 根据 id 删除权限点
export function delPerApi(id) {
  return instance({
    url: `/sys/permission/${id}`,
    method: 'DELETE',
  })
}

// 添加权限点
export function addPerApi(data) {
  return instance({
    url: '/sys/permission',
    method: 'POST',
    data
  })
}

// 获取所有权限点
export function getAllPerApi() {
  return instance({
    url: '/sys/permission',
    method: 'GET',
  })
}
